package com.hqyj.project.controller;


import com.hqyj.project.utils.CommonResult;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.web.util.RedirectView;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 统一异常处理
 */
@RestControllerAdvice
public class ExceptionController {
    /**
     * 权限不足统一处理
     * @return
     */
    @ExceptionHandler(value = UnauthorizedException.class)
    public CommonResult catchUnauthorizedException(){
        return new CommonResult(403,"权限不足，禁止访问！");

    }
}
